package com.huqing.icu.enums;

import lombok.Getter;

/**
 * 社区帖子的审核状态
 *
 * @author huqing
 * @date 2025-07-07 21:53:29
 */
@Getter
public enum PostApproveStatusEnum {

    DEFAULT(0, "默认"),

    PROCESSING(1, "审核中"),

    APPROVED(2, "已通过"),

    FAILED(3, "未通过"),

    //DRAFT(6, "草稿"), //6未用到，因为客户端保存草稿时没调接口，而是存在客户端本地了

    DOWN(7, "下架"),

    ;

    private Integer code;

    private String msg;

    PostApproveStatusEnum(Integer code, String msg) {
        this.code = code;
        this.msg = msg;
    }

    public static PostApproveStatusEnum of(int code) {
        for (PostApproveStatusEnum postApproveStatusEnum : values()) {
            if (postApproveStatusEnum.code.equals(code)) {
                return postApproveStatusEnum;
            }
        }
        return null;
    }
}
